﻿/* ######################################## *\
 * ### Copyright (C) 2009 AJ Ravindiran ### *
\* ######################################## */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using AJRavindiran.Jolt.RuneScape.Database.Characters;
using AJRavindiran.Jolt.RuneScape.Models.Characters;

namespace AJRavindiran.Jolt.RuneScape.Database
{
    /// <summary>
    /// Represents management for account loading and saving.
    /// </summary>
    public class AccountManager
    {
        #region Properties
        private AccountLoader loader = new AccountLoader();
        private AccountSaver saver = new AccountSaver();
        #endregion Properties

        #region Methods
        /// <summary>
        /// Load a character from the database.
        /// </summary>
        /// <param name="character">The character instance.</param>
        /// <returns>Returns true if the loading was successful.</returns>
        public bool LoadCharacter(Character character)
        {
            return loader.Execute(character);
        }

        /// <summary>
        /// Saves a character to the database.
        /// </summary>
        /// <param name="character">The character instance.</param>
        public void SaveCharacter(Character character)
        {
            saver.Execute(character);
        }
        #endregion Methods
    }
}
